from django.db import models

# Create your models here.
class UserInfo(models.Model):
    name=models.CharField(max_length=32) #name字符串类型
    password=models.CharField(max_length=64) #password字符串类型
    age=models.IntegerField(default=2) #age整型
    size=models.IntegerField()
    color=models.CharField(max_length=32)
    whether=models.CharField(max_length=64)
    create_time = models.DateTimeField(null=True, blank=True)




class Department(models.Model):
    title=models.CharField(max_length=16)
"""
create table app01_userinfo(
        id bigint auto_ increment primary key,
        name varchar(32),
        password varchar(64),
        age int
)
"""
###新建数据###
# 本质：insert into app01_department(title)values("销售部")
# Department.objects.create(title="销售部")